<div id="content">
	<div id="mainbar">
		<div class="subheader">
			<h1 id="h-top-questions"><?php echo $title; ?></h1>
			<div class="clearfix"></div>
			<small>Don't you have an account! Please <a href="signup" title="Sign Up">signup</a> for a new account</small>
		</div>
		<div class="form_design">
			<p><?php echo lang('login_subheading');?></p>
		
			<div id="infoMessage"><?php echo $message;?></div>
		
			<?php echo form_open();?>
			<p><?php echo lang('login_identity_label', 'identity');?><?php echo form_input($identity);?></p>
			<p><?php echo lang('login_password_label', 'password');?><?php echo form_input($password);?></p>
			<p><?php echo lang('login_remember_label', 'remember');?><?php echo form_checkbox('remember', '1', FALSE, 'id="remember"');?></p>
			<p><?php echo form_submit('submit', lang('login_submit_btn'));?></p>
		
			<?php echo form_close();?>
			<p><a href="forgot_password"><?php echo lang('login_forgot_password');?></a></p>
			
			<?php /** Facebook Login **/ ?>
			
			<?php
			$ses_user=$this->session->userdata('User');
			if(empty($ses_user)) {
				echo '<img src="" />';
			} else{
				echo '<img src="https://graph.facebook.com/'. $ses_user['id'] .'/picture" width="30" height="30"/><div>'.$ses_user['name'].'</div>';
				echo '<a href="'.$this->session->userdata('logout').'">Logout</a>';
			}
			?>
			<div id="fb-root"></div>
			<script type="text/javascript">
				window.fbAsyncInit = function() {
					FB.init({
						appId:'<?php echo $this->config->item('appID'); ?>', 
						cookie:true, 
						status:true, 
						xfbml:true,
						oauth : true
					});
				};
				
				(function(d) {
					var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
					if (d.getElementById(id)) {return;}
					js = d.createElement('script'); js.id = id; js.async = true;
					js.src = "//connect.facebook.net/en_US/all.js";
					ref.parentNode.insertBefore(js, ref);
				} (document));
				$('#facebook').click(function(e) {
					FB.login(function(response) {
						if(response.authResponse) {
							parent.location ='/fblogin';
						}
					}, {scope: 'email,read_stream,publish_stream,user_birthday,user_location,user_work_history,user_hometown,user_photos'});
				});
			</script>
			<?php /** Facebook Login **/ ?>
			
			
			
		</div>
	</div>
	<?php $this->load->view('layout/sidebar'); ?>
</div>
